<template>
	<view class="my_teaching_container">
		<view class="my_teaching_box">
			<view class="my_teaching_all" v-for="(item, index) in teachList" :key="index">
				<view class="question_box">
					<view class="tip">
						问：
					</view>
					<view class="title">
						{{ item.q }}
					</view>
				</view>
				<view class="answer_box">
					<view class="tip">
						答：
					</view>
					<view class="title">
						{{ item.a }}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				teachType: '',
				teachList: []
			}
		},
		onShow() {

		},
		onLoad(options) {
			if (JSON.parse(decodeURIComponent(options.type))) {
				this.teachType = JSON.parse(decodeURIComponent(options.type))
				this.getQaa()
			}
		},
		methods: {
			// 获取代理教学接口
			getQaa() {
				this.$request('/api/getQandaListFront', {
					type_id: this.teachType
				}, 'GET').then(res => {
					if (res.code == 1) {
						this.teachList = res.data
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
						return
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my_teaching_container {
		padding: 24rpx 20rpx;

		.my_teaching_box {

			.my_teaching_all {
				font-family: all-font;
				background: #FFFFFF;
				border-radius: 10rpx;
				padding: 35rpx 40rpx 46rpx 42rpx;
				margin-top: 14rpx;

				.question_box {
					display: flex;
					align-items: flex-start;
					padding-bottom: 20rpx;

					.tip {}

					.title {
						font-size: 30rpx;
						font-weight: 500;
						color: #262626;
					}
				}

				.answer_box {
					display: flex;

					.tip {}

					.title {
						font-size: 26rpx;
						font-weight: 400;
						color: #808080;
						line-height: 20px;
					}
				}
			}
		}
	}
</style>